// Copyright (C) 2021, Flickering Inc. All rights reserved.
// Author: haiquanchen (haiquanchen@flickering.ai)
const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
    @property
    wide: number = 1;

    private _material: cc.MaterialVariant;

    onLoad() {
        if (this.node.getComponent(cc.Label)) {
            this._material = this.node.getComponent(cc.Label).getMaterial(0);
        } else if (this.node.getComponent(cc.Sprite)) {
            this._material = this.node.getComponent(cc.Sprite).getMaterial(0);
        }
        this._material.setProperty('wide', this.wide);
    }

    start() {}

    // update (dt) {}
}
